home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / editor / chktex.lha / chktex / ChkTeX.rexx < prev    next >
OS/2 REXX Batch file  |  1996-01-25  |  2KB  |  72 lines

  1. /*
  2.  *  ChkTeX v1.2, SCMSG interface.
  3.  *  Copyright (C) 1996 Jens T. Berger Thielemann
  4.  *
  5.  *  This program is free software; you can redistribute it and/or modify
  6.  *  it under the terms of the GNU General Public License as published by
  7.  *  the Free Software Foundation; either version 2 of the License, or
  8.  *  (at your option) any later version.
  9.  *
  10.  *  This program is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *  GNU General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU General Public License
  16.  *  along with this program; if not, write to the Free Software
  17.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  *
  19.  *  Contact the author at:
  20.  *        Jens Berger
  21.  *        Spektrumvn. 4
  22.  *        N-0666 Oslo
  23.  *        Norway
  24.  *        E-mail: <jensthi@ifi.uio.no>    
  25.  *
  26.  *
  27.  */
  28.  
  29. If Arg(1, "O") Then Do
  30.     Call AddLib("rexxreqtools.library", 0, -30, 0)
  31.  
  32.     /* Use reqtools if possible */
  33.  
  34.     If Show("Libraries","rexxreqtools.library") Then Do
  35.         FileName = rtFileRequest( , , "Select LaTeX file", , "rtfi_flags = freqf_patgad" , )
  36.         If RTResult = 0 Then Exit
  37.     End
  38.     Else Do
  39.         Options Prompt "LaTeXFILE/A: "
  40.         Pull FileName
  41.         FileName = Strip(FileName)
  42.     End
  43.     If FileName = "" Then Exit
  44. End
  45. Else FileName = Arg(1)
  46.  
  47. TmpFile = "T:ChkTeX_Temporary_Output"
  48.  
  49. Address Command 'ChkTeX -v0b0qs::: '||FileName||' -o '||TmpFile
  50.  
  51. If RC = 0 Then Do
  52.     If ~Show('ports', 'SC_SCMSG') Then Do
  53.         Address Command 'Run <nil: >nil: SC:C/ScMsg HIDDEN'
  54.         Address Command 'WaitForPort SC_SCMSG'
  55.     End
  56.  
  57.     If Open('File', TmpFile, 'R') Then Do
  58.         Address 'SC_SCMSG'
  59.         DelFile FileName
  60.  
  61.         Do Until Eof('File')
  62.             Line = ReadLn('File')
  63.             Parse Var Line File ':::' Line ':::' Col ':::' ErrNum ':::' Msg
  64.             NewMsg '"'||FileName||'"' '"'||FileName||'"' Line '0 "" 0' "Warning" ErrNum Msg
  65.         End
  66.         Show Activate
  67.         Call Close('File')
  68.         Options FailAt 21
  69.         Address Command 'Delete <nil: >nil: ' TmpFile
  70.     End
  71. End
  72.